﻿using System;
using System.Reflection;
using System.Configuration;
//using KPIS.DBM;
using KPIS.GERP.GHRMS.IDAL;

namespace KPIS.GERP.GHRMS.DALFactory
{
    [Serializable]
    public class DataAccess
    {
        
        private static readonly string path = ConfigurationManager.AppSettings["WebDAL"];

        private DataAccess() { }
        // ----------------------------- Systems -----------------------------------------------
        public static ISysMenuItemListDAL CreateSysMenuItemList()
        {
            string className = path + ".SysMenuItemListDAL";
            return (ISysMenuItemListDAL)Assembly.Load(path).CreateInstance(className);
        }
        // ----------------------------- Tree View -----------------------------------------------
        public static ITreeViewDAL CreateTreeView()
        {
            string className = path + ".TreeViewDAL";
            return (ITreeViewDAL)Assembly.Load(path).CreateInstance(className);
        }
        // ----------------------------- Master Data -----------------------------------------------
        public static IMasRecordStatusDAL CreateMasRecordStatus()
        {
            string className = path + ".MasRecordStatusDAL";
            return (IMasRecordStatusDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IAddressDAL CreateAddress()
        {
            string className = path + ".AddressDAL";
            return (IAddressDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasAmphurDAL CreateMasterAmphurs()
        {
            string className = path + ".MasAmphurDAL";
            return (IMasAmphurDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasAreaDAL CreateMasterAreas()
        {
            string className = path + ".MasAreaDAL";
            return (IMasAreaDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasBloodGroupDAL CreateMasterBloodGroups()
        {
            string className = path + ".MasBloodGroupDAL";
            return (IMasBloodGroupDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasCityDAL CreateMasterCity()
        {
            string className = path + ".MasCityDAL";
            return (IMasCityDAL)Assembly.Load(path).CreateInstance(className);
        }
        
        public static IMasCountryDAL CreateMasterCountry()
        {
            string className = path + ".MasCountryDAL";
            return (IMasCountryDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasCountryZoneDAL CreateMasterCountryZone()
        {
            string className = path + ".MasCountryZoneDAL";
            return (IMasCountryZoneDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasDistrictDAL CreateMasterDistricts()
        {
            string className = path + ".MasDistrictDAL";
            return (IMasDistrictDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasEducationDegreeDAL CreateMasterEducationDegree()
        {
            string className = path + ".MasEducationDegreeDAL";
            return (IMasEducationDegreeDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasEducationInstituteDAL CreateMasterEducationInstitute()
        {
            string className = path + ".MasEducationInstituteDAL";
            return (IMasEducationInstituteDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasEducationMajorDAL CreateMasterEducationMajor()
        {
            string className = path + ".MasEducationMajorDAL";
            return (IMasEducationMajorDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasEducationQualificationDAL CreateMasterEducationQualification()
        {
            string className = path + ".MasEducationQualificationDAL";
            return (IMasEducationQualificationDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasFamilyHoodDAL CreateMasterFamilyHoods()
        {
            string className = path + ".MasFamilyHoodDAL";
            return (IMasFamilyHoodDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasGenderDAL CreateMasterGender()
        {
            string className = path + ".MasGenderDAL";
            return (IMasGenderDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasNamePrefixDAL CreateMasterNamePrefixes()
        {
            string className = path + ".MasNamePrefixDAL";
            return (IMasNamePrefixDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasNationalitiesDAL CreateMasterNationalities()
        {
            string className = path + ".MasNationalitiesDAL";
            return (IMasNationalitiesDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasProvinceDAL CreateMasterProvinces()
        {
            string className = path + ".MasProvinceDAL";
            return (IMasProvinceDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasRegionDAL CreateMasterRegions()
        {
            string className = path + ".MasRegionDAL";
            return (IMasRegionDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasReligionDAL CreateMasterReligions()
        {
            string className = path + ".MasReligionDAL";
            return (IMasReligionDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasMaritalStatusDAL CreateMasterMaritalStatus()
        {
            string className = path + ".MasMaritalStatusDAL";
            return (IMasMaritalStatusDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IMasSpecialSkillTypeDAL CreateMasterSpecialSkillTypes()
        {
            string className = path + ".MasSpecialSkillTypeDAL";
            return (IMasSpecialSkillTypeDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IWorkAreaDAL CreateWorkAreas()
        {
            string className = path + ".WorkAreaDAL";
            return (IWorkAreaDAL)Assembly.Load(path).CreateInstance(className);
        }
        // ----------------------------------------------------------------------------
        public static IJobSiteTypeDAL CreateJobSiteTypes()
        {
            string className = path + ".JobSiteTypeDAL";
            return (IJobSiteTypeDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IJobSiteLevelDAL CreateJobSiteLevels()
        {
            string className = path + ".JobSiteLevelDAL";
            return (IJobSiteLevelDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IJobSiteDAL CreateJobSites()
        {
            string className = path + ".JobSiteDAL";
            return (IJobSiteDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IJobSiteAreaDAL CreateJobSiteAreas()
        {
            string className = path + ".JobSiteAreaDAL";
            return (IJobSiteAreaDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IJobSiteCommandDAL CreateJobSiteCommands()
        {
            string className = path + ".JobSiteCommandDAL";
            return (IJobSiteCommandDAL)Assembly.Load(path).CreateInstance(className);
        }
        // ----------------------------------------------------------------------------
        // ------------------------------ Personal ------------------------------------

        public static IEmployeeDAL CreateEmployees()
        {
            string className = path + ".EmployeeDAL";
            return (IEmployeeDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IEmployeeStatusDAL CreateEmployeeStatuses()
        {
            string className = path + ".EmployeeStatusDAL";
            return (IEmployeeStatusDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IEmployeeTypeDAL CreateEmployeeTypes()
        {
            string className = path + ".EmployeeTypeDAL";
            return (IEmployeeTypeDAL)Assembly.Load(path).CreateInstance(className);
        }
        // -------------------------------Histories------------------------------------
        public static IChildrenDAL CreateChildrens()
        {
            string className = path + ".ChildrenDAL";
            return (IChildrenDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IContactDAL CreateContacts()
        {
            string className = path + ".ContactDAL";
            return (IContactDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IHisEducationDAL CreateHisEducations()
        {
            string className = path + ".HisEducationDAL";
            return (IHisEducationDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IHisNameDAL CreateHisNames()
        {
            string className = path + ".HisNameDAL";
            return (IHisNameDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IHisSpouseDAL CreateHisSpouses()
        {
            string className = path + ".HisSpouseDAL";
            return (IHisSpouseDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IParentDAL CreateParents()
        {
            string className = path + ".ParentDAL";
            return (IParentDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static ISpecialSkillDAL CreateSpecialSkills()
        {
            string className = path + ".SpecialSkillDAL";
            return (ISpecialSkillDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static ISpecialExpertDAL CreateSpecialExpert()
        {
            string className = path + ".SpecialExpertDAL";
            return (ISpecialExpertDAL)Assembly.Load(path).CreateInstance(className);
        }
        // -------------------------------TimeAttendant------------------------------------
        public static INonWorkingDayDAL CreateNonWorkingDays()
        {
            string className = path + ".NonWorkingDayDAL";
            return (INonWorkingDayDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static INonWorkingJobSiteDAL CreateNonWorkingJobSites()
        {
            string className = path + ".NonWorkingJobSiteDAL";
            return (INonWorkingJobSiteDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IAbsenceTypeDAL CreateAbsenceTypes()
        {
            string className = path + ".AbsenceTypeDAL";
            return (IAbsenceTypeDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IAbsenceRuleDAL CreateAbsenceRules()
        {
            string className = path + ".AbsenceRuleDAL";
            return (IAbsenceRuleDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IAbsenceDAL CreateAbsences()
        {
            string className = path + ".AbsenceDAL";
            return (IAbsenceDAL)Assembly.Load(path).CreateInstance(className);
        }
        // -------------------------------Retirements------------------------------------
        public static IRetirementDAL CreateRetirements()
        {
            string className = path + ".RetirementDAL";
            return (IRetirementDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IRetirementDetailDAL CreateRetirementDetails()
        {
            string className = path + ".RetirementDetailDAL";
            return (IRetirementDetailDAL)Assembly.Load(path).CreateInstance(className);
        }
        // -------------------------------RoyalItems------------------------------------
        public static IRoyalItemTypeDAL CreateRoyalItemTypes()
        {
            string className = path + ".RoyalItemTypeDAL";
            return (IRoyalItemTypeDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IRoyalItemDAL CreateRoyalItems()
        {
            string className = path + ".RoyalItemDAL";
            return (IRoyalItemDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IRoyalItemRepayDAL CreateRoyalItemRepays()
        {
            string className = path + ".RoyalItemRepayDAL";
            return (IRoyalItemRepayDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IRoyalItemRepayDetailDAL CreateRoyalItemRepayDetails()
        {
            string className = path + ".RoyalItemRepayDetailDAL";
            return (IRoyalItemRepayDetailDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IRoyalItemHistoriesDAL CreateRoyalItemHistories()
        {
            string className = path + ".RoyalItemHistoriesDAL";
            return (IRoyalItemHistoriesDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IRoyalItemRequestDAL CreateRoyalItemRequests()
        {
            string className = path + ".RoyalItemRequestDAL";
            return (IRoyalItemRequestDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IRoyalItemControlDAL CreateRoyalItemControls()
        {
            string className = path + ".RoyalItemControlDAL";
            return (IRoyalItemControlDAL)Assembly.Load(path).CreateInstance(className);
        }
        // ------------------------------ Position ------------------------------------
        
        public static IClassDAL CreateClasses()
        {
            string className = path + ".ClassDAL";
            return (IClassDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IClassSpecificationDAL CreateClassSpecifications()
        {
            string className = path + ".ClassSpecificationDAL";
            return (IClassSpecificationDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IDutyDAL CreateDuties()
        {
            string className = path + ".DutyDAL";
            return (IDutyDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IExecutiveDAL CreateExecutives()
        {
            string className = path + ".ExecutiveDAL";
            return (IExecutiveDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IFieldDAL CreateFields()
        {
            string className = path + ".FieldDAL";
            return (IFieldDAL)Assembly.Load(path).CreateInstance(className);
        } 
        public static IFieldGroupDAL CreateFieldGroups()
        {
            string className = path + ".FieldGroupDAL";
            return (IFieldGroupDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IFieldDutyDAL CreateFieldDuties()
        {
            string className = path + ".FieldDutyDAL";
            return (IFieldDutyDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IFieldDutyDtlsDAL CreateFieldDutyDetails()
        {
            string className = path + ".FieldDutyDtlsDAL";
            return (IFieldDutyDtlsDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IFieldSpecificationDAL CreateFieldSpecifications()
        {
            string className = path + ".FieldSpecificationDAL";
            return (IFieldSpecificationDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IFieldSpecDetailDAL CreateFieldSpecDetails()
        {
            string className = path + ".FieldSpecDetailDAL";
            return (IFieldSpecDetailDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IPositionDAL CreatePositions()
        {
            string className = path + ".PositionDAL";
            return (IPositionDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IPositionStatusDAL CreatePositionStatuses()
        {
            string className = path + ".PositionStatusDAL";
            return (IPositionStatusDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IPositionTypeDAL CreatePositionTypes()
        {
            string className = path + ".PositionTypeDAL";
            return (IPositionTypeDAL)Assembly.Load(path).CreateInstance(className);
        }
        // -------------------------------Recruitment------------------------------------

        public static IRecruitMoveRequestDAL CreateRecruitMoveRequest()
        {
            string className = path + ".RecruitMoveRequestDAL";
            return (IRecruitMoveRequestDAL)Assembly.Load(path).CreateInstance(className);
        }

        // -------------------------------Commands------------------------------------
        public static IMovmentDAL CreateMovments()
        {
            string className = path + ".MovmentDAL";
            return (IMovmentDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static ICommandDAL CreateCommands()
        {
            string className = path + ".CommandDAL";
            return (ICommandDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static ICommandDetailDAL CreateCommandDetails()
        {
            string className = path + ".CommandDetailDAL";
            return (ICommandDetailDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IInquireDAL CreateInquire()
        {
            string className = path + ".InquireDAL";
            return (IInquireDAL)Assembly.Load(path).CreateInstance(className);
        }
		public static IHisHealthCheckDAL CreateHisHealthCheck()
		{
			string className = path + ".HisHealthCheckDAL";
			return (IHisHealthCheckDAL)Assembly.Load(path).CreateInstance(className);
		}
		public static IHealthDAL CreateHealth()
		{
			string className = path + ".HealthDAL";
			return (IHealthDAL)Assembly.Load(path).CreateInstance(className);
		}

        // -------------------------------KPA------------------------------------
        public static IHRMKeyPerformanceAreaListDAL CreateKeyArea()
        {
            string className = path + ".HRMKeyPerformanceAreaListDAL";
            return (IHRMKeyPerformanceAreaListDAL)Assembly.Load(path).CreateInstance(className);
        }

        //-----------------------------------------------------------------------
        public static IHRDEvaluationDAL Evaluation()
        {
            string className = path + ".HRDEvaluationDAL";
            return (IHRDEvaluationDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IHRMJobSpecListDAL CreateJobSpecList()
        {
            string className = path + ".HRMJobSpecListDAL";
            return (IHRMJobSpecListDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IHRMIndividualDevPlanDAL CreateIndividualDevPlan()
        {
            string className = path + ".HRMIndividualDevPlanDAL";
            return (IHRMIndividualDevPlanDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static IHRMCoreCompetencyListDAL CreateCoreCompetencyList()
        {
            string className = path + ".HRMCoreCompetencyListDAL";
            return (IHRMCoreCompetencyListDAL)Assembly.Load(path).CreateInstance(className);
        }

        public static IPerformanceAgreementDAL CreatPerformanceAgreement()
        {
            string className = path + ".PerformanceAgreementDAL";
            return (IPerformanceAgreementDAL)Assembly.Load(path).CreateInstance(className);
        }

        public static ITrainingCoreCompetencyDAL CreatTrainingCoreCompetency()
        {
            string className = path + ".TrainingCoreCompetencyDAL";
            return (ITrainingCoreCompetencyDAL)Assembly.Load(path).CreateInstance(className); 
        }
        public static IComponentEvaluateDAL CreatComponentEvaluate()
        {
            string className = path + ".ComponentEvaluateDAL";
            return (IComponentEvaluateDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static ILabourRelationDAL CreatLabourRelation()
        {
            string className = path + ".LabourRelationDAL";
            return (ILabourRelationDAL)Assembly.Load(path).CreateInstance(className);
        }
        public static ITrainingHistoryDAL CreateTrainingHis()
        {
            string className = path + ".TrainingHistoryDAL";
            return (ITrainingHistoryDAL)Assembly.Load(path).CreateInstance(className);
        }
    }
}
